import {LESSON_SERVER_AXIOS} from '@/api/axios';

// GET - 查询个人信息: 查询个人信息
export const SELECT_PERSONAL = () => LESSON_SERVER_AXIOS.get("/user/selectPersonal");
// GET - 获取验证码: 按手机号获取一个4位的随机验证码
export const GENERATE_VCODE = (phone) => LESSON_SERVER_AXIOS.get("/user/generateVcode", {params: {phone}});
// GET - 查询个人积分: 查询个人积分
export const SELECT_POINTS = () => LESSON_SERVER_AXIOS.get("/user/selectPoints");
// POST - 注册一条用户记录: 需要传入账号，密码，真实姓名，身份证号和手机号
export const REGISTER = (params) => LESSON_SERVER_AXIOS.post("/user/register", params);
// POST - 按账号密码登录: 需要传入账号和密码，无需token验证，登录后会返回token和当前用户信息
export const LOGIN_BY_ACCOUNT = (params) => LESSON_SERVER_AXIOS.post("/user/loginByAccount", params);
// POST - 修改个人信息: 可选传入新昵称，新性别，新年龄，手机号和新描述
export const UPDATE_PERSONAL = (params) => LESSON_SERVER_AXIOS.post("/user/updatePersonal", params);
// POST - 修改个人密码: 需要传入原密码和新密码
export const UPDATE_PASSWORD = (params) => LESSON_SERVER_AXIOS.post("/user/updatePassword", params);
// POST - 注销个人账号: 注销个人账号
export const DELETE_PERSONAL = () => LESSON_SERVER_AXIOS.post("/user/deletePersonal");
// POST - 上传个人头像: 需要传入新头像文件
export const UPLOAD_AVATAR = (params) => LESSON_SERVER_AXIOS.post("/user/uploadAvatar", params, {
    headers: {'Content-Type': 'multipart/form-data'}
});
// POST - 按手机号登录: 按手机号码和验证码进行登录
export const LOGIN_BY_PHONE = (params) => LESSON_SERVER_AXIOS.post("/user/loginByPhone", params);